<?php
namespace app\index\controller;

use think\Controller;
use app\index\service\InstrumentService;
class Instrument extends Controller
{
    private $instrumentService;

    /**
     * 依赖注入 Service
     *
     * @param InstrumentService $instrumentService
     * @author zws
     */
    public function __construct(InstrumentService $instrumentService)
    {
        parent::__construct();
        $this->instrumentService = $instrumentService;
    }

    /**
     * 查询仪器项目
     * @return \think\response\Json
     * @author zws
     */
    public function index()
    {
        $input = $this->request->input;
        $result = $this->instrumentService->index($input);
        return app_response(200, $result);
    }

    public function create()
    {
        $input = $this->request->input;
        $result = $this->instrumentService->create($input);

        return app_response(200, $result ? '创建成功' : '创建失败');
    }
}